#include <windows.h>   // Standard Header For Most Programs
#include "Block.hpp"

OpenGLDevice* gDevice;

void display ( void )   
{
	draw<Something>(*gDevice);
}


void reshape ( int width , int height )
{
	set<Viewport>(*gDevice);
	set<Perspective>(*gDevice);
}


void keyboard ( unsigned char key, int x, int y )  // Create Keyboard Function
{
	switch ( key ) {
case 27:        // When Escape Is Pressed...
	exit ( 0 );   // Exit The Program
	break;        // Ready For Next Case
default:        // Now Wrap It Up
	break;
	}
}

//void arrow_keys ( int a_keys, int x, int y )  // Create Special Function (required for arrow keys)
//{
//	switch ( a_keys ) {
//case GLUT_KEY_UP:     // When Up Arrow Is Pressed...
//	glutFullScreen ( ); // Go Into Full Screen Mode
//	break;
//case GLUT_KEY_DOWN:               // When Down Arrow Is Pressed...
//	glutReshapeWindow ( 500, 500 ); // Go Into A 500 By 500 Window
//	break;
//default:
//	break;
//	}
//}

void close(void)
{
	if(gDevice) delete(gDevice);

}

void main ( int argc, char** argv )   // Create Main Function For Bringing It All Together
{
	create<GLUTWindows>(argc, argv);
	create<DisplayCallBack>( display );
	create<ReshapeCallBack>( reshape );
	create<KeyboardCallBack>( keyboard );	
	
	gDevice= new(OpenGLDevice);
	
	set<OpenGLDevice>(*gDevice);
	set<GPUProgram>(*gDevice);

	glutMainLoop( ); 

	close();
}